package threeRegInstructions;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

import main.MIPSSimulator;

public class Sllv extends MIPSThreeRegInstruction {
	public Sllv(String input) throws FileNotFoundException, IOException {
		myRecognizedRegisters.load(new FileInputStream(new File(
				"recognizedRegisters.properties")));
		myRegisterOne = myRecognizedRegisters.getProperty(input.substring(16,
				21));
		myRegisterTwo = myRecognizedRegisters.getProperty(input
				.substring(11, 16));
		myRegisterThree = myRecognizedRegisters.getProperty(input.substring(6,
				11));
		myName = "sllv";
	}

	@Override
	public void execute() {
		int regTwo = MIPSSimulator.myRegisters.get(myRegisterTwo);
		int regThree = MIPSSimulator.myRegisters.get(myRegisterThree);
		MIPSSimulator.myRegisters.put(myRegisterOne, regTwo << regThree);
	}
}
